<h2>grid.js</h2>
<p>Advanced grid control.</p>
<hr/>

<h3>Objects</h3>
<ul>
	<li><a href="#grid">OAT.Grid(element, optionsObject)</a></li>
</ul>

<h3>Methods</h3>
<ul>
	<li><a href="#createrow">OAT.Grid.createRow(data, [index])</a></li>
	<li><a href="#createheader">OAT.Grid.createHeader(data)</a></li>
	<li><a href="#appendheader">OAT.Grid.appendHeader(data, [index])</a></li>
	<li><a href="#fromtable">OAT.Grid.fromTable(table)</a></li>
	<li><a href="#addcell">OAT.Grid.row.addCell(data, [index])</a></li>
	<li><a href="#removecolumn">OAT.Grid.removeColumn(index)</a></li>
	<li><a href="#cleardata">OAT.Grid.clearData()</a></li>
</ul>

<h3>Constants</h3>
<ul>
	<li>OAT.Grid.ALIGN_CENTER</li>
	<li>OAT.Grid.ALIGN_LEFT</li>
	<li>OAT.Grid.ALIGN_RIGHT</li>
	<li>OAT.Grid.SORT_NONE</li>
	<li>OAT.Grid.SORT_ASC</li>
	<li>OAT.Grid.SORT_DESC</li>
	<li>OAT.Grid.TYPE_AUTO</li>
	<li>OAT.Grid.TYPE_STRING</li>
	<li>OAT.Grid.TYPE_NUMERIC</li>
</ul>

<h3>CSS classes</h3>
<ul>
	<li>.grid</li>
	<li>.even</li>
	<li>.odd</li>
	<li>.hover</li>
	<li>.index</li>
	<li>.header_value</li>
	<li>.row_value</li>
</ul>

<hr/>

<h3><a name="grid">OAT.Grid(element, optionsObject)</a></h3>
<p>Creates a grid as a child of <em>element</em>. <em>optionsObject</em> may contain:</p>
<ul>
	<li>autoNumber - Grid will automatically add the first auto-numbered column</li>
	<li>rowOffset - starting offset for auto-numbered column</li>
	<li>allowColumnHiding - user can toggle column visibility at runtime</li>
	<li>sortFunc - custom user-specified sorting routine</li>
	<li>imagePath - path to images (with trailing slash)</li>
	<li>reorderNotifier - routine to be called when column reordering occurs</li>
</ul>	

<h3><a name="createrow">OAT.Grid::createRow(data, [index])</a></h3>
<p>Adds a row. If <em>index</em> is present, it specifies at which index the new row should be inserted. <em>Data</em> 
is an array of either values or objects. If objects are used, they should contain:</p>
<ul>
	<li>value - cell value</li>
	<li>align - one of ALIGN_ constants</li>
</ul>

<h3><a name="createheader">OAT.Grid::createHeader(data)</a></h3>
<p>Creates a header row. <em>Data</em> is an array of either values or objects. 
If objects are used, they should contain:</p>
<ul>
	<li>value - cell value</li>
	<li>sortable - whether this column is sortable</li>
	<li>draggable - whether this column is draggable</li>
	<li>resizable - whether this column is resizable</li>
	<li>align - one of ALIGN_ constants</li>
	<li>sort - one of SORT_ constants</li>
	<li>type - one of TYPE_ constants</li>
</ul>

<h3><a name="appendheader">OAT.Grid::appendHeader(data, [index])</a></h3>
<p>Adds a new header cell. If <em>index</em> is present, it specifies at which index the new cell should be inserted. 
Data are in the same format as in <code>createHeader</code>.</p>

<h3><a name="fromtable">OAT.Grid::fromTable(table)</a></h3>
<p>Converts an existing <em>table</em> into a grid.</p>

<h3><a name="addcell">OAT.Grid::row::addCell(data, [index])</a></h3>
<p>Adds one cell to one row. If <em>index</em> is present, it specifies at which index new cell should be inserted. 
Data are in the same format as in <code>createRow</code>. This method should be called as <code>grid.rows[i].addCell()</code>.</p>

<h3><a name="removecolumn">OAT.Grid::removeColumn(index)</a></h3>
<p>Removes one column from the grid.</p>

<h3><a name="cleardata">OAT.Grid::clearData()</a></h3>
<p>Clears the grid (preserves header).</p>
